#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QStringListModel>
#include "tdownload.h"
#include "listcalc.h"
#include <QFile>
#include <QCryptographicHash>
#include <QTextStream>
#include <QUrl>
#include <QProcess>


namespace Ui {
class MainWindow;
}

class MainWindow : public QWidget
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void                    closeEvent(QCloseEvent * event );
    void                    downloadlst();
    
private slots:
    void my_quit();
    void updateDataReadProgress(int bytesRead, int totalBytes);
    void execute();
    void fullCheck();
    void dlFinish();
    void increaseTotalCounter();
    void setStatusLabel(QString);
    void setModel(QStringListModel *);
    void setTPbar(int);
    void setTPbarVal(int);
    void launchDownload();
private:
    Ui::MainWindow          *ui;
    int                     file_dl;
    int                     file_count;
    QStringList             file_list;
    QStringList             hash_list;
    QString                 addr_server;
    TDownload               *ThreadDownload;
    ListCalc                *threadList;
    void                    getFileList(bool);
    QString                 CalcSha1(QString Path);

};

#endif // MAINWINDOW_H
